home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.4 KB  |  220 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1988-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CTBUtilities;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CTBUTILITIES__}
  27. {$SETC __CTBUTILITIES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __CONDITIONALMACROS__}
  34. {$I ConditionalMacros.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MACTYPES__}
  37. {$I MacTypes.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __MIXEDMODE__}
  40. {$I MixedMode.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __DIALOGS__}
  43. {$I Dialogs.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __APPLETALK__}
  46. {$I AppleTalk.p}
  47. {$ENDC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54.  
  55. CONST
  56.     curCTBUVersion                = 2;                            {  version of Comm Toolbox Utilities }
  57.  
  58.                                                                 {     Error codes/types     }
  59.     ctbuGenericError            = -1;
  60.     ctbuNoErr                    = 0;
  61.  
  62.  
  63. TYPE
  64.     CTBUErr                                = OSErr;
  65.  
  66. CONST
  67.     chooseDisaster                = -2;
  68.     chooseFailed                = -1;
  69.     chooseAborted                = 0;
  70.     chooseOKMinor                = 1;
  71.     chooseOKMajor                = 2;
  72.     chooseCancel                = 3;
  73.  
  74.  
  75. TYPE
  76.     ChooseReturnCode                    = UInt16;
  77.  
  78. CONST
  79.     nlOk                        = 0;
  80.     nlCancel                    = 1;
  81.     nlEject                        = 2;
  82.  
  83.  
  84. TYPE
  85.     NuLookupReturnCode                    = UInt16;
  86.  
  87. CONST
  88.     nameInclude                    = 1;
  89.     nameDisable                    = 2;
  90.     nameReject                    = 3;
  91.  
  92.  
  93. TYPE
  94.     NameFilterReturnCode                = UInt16;
  95.  
  96. CONST
  97.     zoneInclude                    = 1;
  98.     zoneDisable                    = 2;
  99.     zoneReject                    = 3;
  100.  
  101.  
  102. TYPE
  103.     ZoneFilterReturnCode                = UInt16;
  104.  
  105. CONST
  106.                                                                 {     Values for hookProc items         }
  107.     hookOK                        = 1;
  108.     hookCancel                    = 2;
  109.     hookOutline                    = 3;
  110.     hookTitle                    = 4;
  111.     hookItemList                = 5;
  112.     hookZoneTitle                = 6;
  113.     hookZoneList                = 7;
  114.     hookLine                    = 8;
  115.     hookVersion                    = 9;
  116.     hookReserved1                = 10;
  117.     hookReserved2                = 11;
  118.     hookReserved3                = 12;
  119.     hookReserved4                = 13;                            {     "virtual" hookProc items     }
  120.     hookNull                    = 100;
  121.     hookItemRefresh                = 101;
  122.     hookZoneRefresh                = 102;
  123.     hookEject                    = 103;
  124.     hookPreflight                = 104;
  125.     hookPostflight                = 105;
  126.     hookKeyBase                    = 1000;
  127.  
  128.  
  129. {    NuLookup structures/constants    }
  130.  
  131. TYPE
  132.     NLTypeEntryPtr = ^NLTypeEntry;
  133.     NLTypeEntry = RECORD
  134.         hIcon:                    Handle;
  135.         typeStr:                Str32;
  136.     END;
  137.  
  138.     NLType                                = ARRAY [0..3] OF NLTypeEntry;
  139.     NBPReplyPtr = ^NBPReply;
  140.     NBPReply = RECORD
  141.         theEntity:                EntityName;
  142.         theAddr:                AddrBlock;
  143.     END;
  144.  
  145. {$IFC TYPED_FUNCTION_POINTERS}
  146.     DialogHookProcPtr = FUNCTION(item: INTEGER; theDialog: DialogPtr): INTEGER;
  147. {$ELSEC}
  148.     DialogHookProcPtr = ProcPtr;
  149. {$ENDC}
  150.  
  151. {$IFC TYPED_FUNCTION_POINTERS}
  152.     NameFilterProcPtr = FUNCTION({CONST}VAR theEntity: EntityName): INTEGER;
  153. {$ELSEC}
  154.     NameFilterProcPtr = ProcPtr;
  155. {$ENDC}
  156.  
  157. {$IFC TYPED_FUNCTION_POINTERS}
  158.     ZoneFilterProcPtr = FUNCTION(theZone: Str32): INTEGER;
  159. {$ELSEC}
  160.     ZoneFilterProcPtr = ProcPtr;
  161. {$ENDC}
  162.  
  163.     DialogHookUPP = UniversalProcPtr;
  164.     NameFilterUPP = UniversalProcPtr;
  165.     ZoneFilterUPP = UniversalProcPtr;
  166.  
  167. CONST
  168.     uppDialogHookProcInfo = $000003A0;
  169.     uppNameFilterProcInfo = $000000E0;
  170.     uppZoneFilterProcInfo = $000000E0;
  171.  
  172. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  173.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  174.     INLINE $2E9F;
  175.     {$ENDC}
  176.  
  177. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  178.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  179.     INLINE $2E9F;
  180.     {$ENDC}
  181.  
  182. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  183.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  184.     INLINE $2E9F;
  185.     {$ENDC}
  186.  
  187. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  188.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  189.     INLINE $205F, $4E90;
  190.     {$ENDC}
  191.  
  192. FUNCTION CallNameFilterProc({CONST}VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  194.     INLINE $205F, $4E90;
  195.     {$ENDC}
  196.  
  197. FUNCTION CallZoneFilterProc(theZone: Str32; userRoutine: ZoneFilterUPP): INTEGER;
  198.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  199.     INLINE $205F, $4E90;
  200.     {$ENDC}
  201. FUNCTION InitCTBUtilities: CTBUErr;
  202. FUNCTION CTBGetCTBVersion: INTEGER;
  203. FUNCTION StandardNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  204. FUNCTION CustomNBP(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  205. {$IFC OLDROUTINENAMES }
  206. FUNCTION NuLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  207. FUNCTION NuPLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  208. {$ENDC}  {OLDROUTINENAMES}
  209.  
  210. {$ALIGN RESET}
  211. {$POP}
  212.  
  213. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  214.  
  215. {$ENDC} {__CTBUTILITIES__}
  216.  
  217. {$IFC NOT UsingIncludes}
  218.  END.
  219. {$ENDC}
  220.